//
//  LGHomeController.m
//  微博oc版
//
//  Created by Apple_Lzzy27 on 16/10/10.
//  Copyright © 2016年 Apple_Lzzy27. All rights reserved.
//

#import "LGHomeController.h"
#import "LGTestController.h"
#import "LGStatusLIstViewModel.h"
#import "LGNetWorkingManager.h"


@interface LGHomeController ()
@property(nonatomic, strong) LGStatusLIstViewModel *statusList;
@end

@implementation LGHomeController


- (LGStatusLIstViewModel *)statusList{
    
    if (_statusList == nil) {
        
        _statusList = [[LGStatusLIstViewModel alloc] init];
        
    }
    
    return _statusList;
}


- (void)viewDidLoad {
    [super viewDidLoad];
 
    
}
- (void)setTableView{
    [super setTableView];
    [self setNavButton];
    
}
- (void)setNavButton{
    
    
    self.navItem.leftBarButtonItem = [UIBarButtonItem BarButtonCustButton:@"好友" fontSize:14 addTarget:self action:@selector(frenid) isBack:NO];
    
  
}

//好友
- (void)frenid{
    
    LGTestController *test = [[LGTestController alloc] init];
    [self.navigationController pushViewController:test animated:YES];
    
    
}
- (void)loadData{


    [self.statusList  status:self.isFull completion:^(BOOL isSuccess) {
       
        if (isSuccess) {
            
            [self.tableView reloadData];
            [self.refresh endRefreshing];
            self.isFull = NO;
        }
        
    }];
    
    
  

    
    
    
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return self.statusList.statusListArray.count;
    
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    static NSString *ID = @"cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    
    
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
    }
    LGStatusListModel *model = self.statusList.statusListArray[indexPath.row];
    cell.textLabel.text = model.text;
    
    return cell;
}






@end
